All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.players.QTPlayer

java.lang.Object
   |
   +----quicktime.app.time.Tasking
           |
           +----quicktime.app.players.QTPlayer

public class QTPlayer
extends Tasking
implements QTDrawable, Playable, AudioSpec, MouseListener, KeyListener
The QTPlayer class allows your application to display, play and control any QuickTime movie with the standard QuickTime movie controller. The QTPlayer object works with the QTCanvas to be displayed in a Java AWT Container.

See Also:
QTCanvas, MovieController

Constructor Index

 o QTPlayer(MovieController)
This constructor creates a QTPlayer object given a QuickTime MovieController object.

Method Index

 o addedTo(Object)
This method is called by the specified object when the instance of the class that implements this interface is added to the object that is the source of the interest.
 o getClip()
This method allows you to obtain information describing a QTPlayer's clipping regions.
 o getDisplayBounds()
This method is called automatically via the QTCanvas object associated with this client to set the boundary of the movie.
 o getDuration()
Returns the duration of the media attached to the player.
 o getGWorld()
QTCanvas calls this method to get the destination QDGraphics of its client.
 o getInitialSize()
This method returns the original size before the transformations specified in the returned matrix are applied.
 o getMatrix()
This will return the client's current display transformations
 o getMovieController()
This allows you to access the contained movie controller.
 o getRate()
Returns the current rate of the player.
 o getScale()
Returns the time scale of the player - how many ticks per second.
 o getTime()
Returns the current time value of the object.
 o getTimeBase()
 o getVolume()
Returns the volume setting (0 is silent or muted, 1 is unity gain)
 o isControllerSizeReserved()
Returns true if display space is being reserved for the size of the controller
 o isControllerVisible()
Returns the visible state of the controller.
 o isMuted()
Returns the current mute status
 o keyPressed(KeyEvent)
Key pressed events are passed on to the movie controller
 o keyReleased(KeyEvent)
 o keyTyped(KeyEvent)
 o mouseClicked(MouseEvent)
 o mouseEntered(MouseEvent)
 o mouseExited(MouseEvent)
 o mousePressed(MouseEvent)
Mouse pressed events are passed on to the movie controller
 o mouseReleased(MouseEvent)
 o redraw(Region)
QTCanvas calls this method when the client should redraw itself.
 o removedFrom(Object)
This method is called by the specified object when the instance of the class that implements this interface is removed from the object that is the source of the interest.
 o setClip(Region)
This method allows you to set a QTPlayer's clipping region.
 o setControllerSizeReserved(boolean)
Sets parameters on the resize of the controller.
 o setControllerVisible(boolean)
If true makes the MovieController visible, otherwise makes it invisible
 o setDisplayBounds(QDRect)
This method is called automatically via the QTCanvas object associated with this client to set the boundary of the movie.
 o setGWorld(QDGraphics)
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing.
 o setLocation(int, int)
A convenience method to set the position of a QTDrawable object.
 o setMatrix(Matrix)
This method sets the current matrix of the Transformable object to the new matrix.
 o setMuted(boolean)
Allows the muting of the specific channel.
 o setRate(float)
Sets the player to the playback rate.
 o setTime(int)
Sets the player to the time specified.
 o setVolume(float)
Sets the volume.
 o task()
This method performs idle processing for the QTPlayer and will be automatically called if this object is added to the TaskThread object.

Constructors

 o QTPlayer
 public QTPlayer(MovieController mc) throws StdQTException
This constructor creates a QTPlayer object given a QuickTime MovieController object.

Parameters:
mc - a MovieController object

Methods

 o getMovieController
 public MovieController getMovieController()
This allows you to access the contained movie controller.

 o getInitialSize
 public Dimension getInitialSize() throws QTException
This method returns the original size before the transformations specified in the returned matrix are applied.

 o getMatrix
 public Matrix getMatrix() throws StdQTException
This will return the client's current display transformations

Returns:
the display transformations of the client
 o setMatrix
 public void setMatrix(Matrix matrix) throws QTException
This method sets the current matrix of the Transformable object to the new matrix.

 o getGWorld
 public QDGraphics getGWorld() throws StdQTException
QTCanvas calls this method to get the destination QDGraphics of its client.

Returns:
a QDGraphics object or null
 o setGWorld
 public synchronized void setGWorld(QDGraphics cgp) throws QDException, StdQTException
QTCanvas calls this method to give the client the QDGraphics object it should use to do its drawing. If the incoming QDGraphics is the QDGraphics.scratch then the drawable will not be visible and can disable itself. If a client is unable to set the graphics world it should throw an exception.

Parameters:
cgp - a QDGraphics object
 o redraw
 public final synchronized void redraw(Region invalidRgn) throws QTException
QTCanvas calls this method when the client should redraw itself. If the canvas is able to discern that only a part of the client's drawing area needs to be redrawn - then this area shall be passed in using the invalidRgn. Otherwise this will be null in which case the client should redraw itself entirely.

Parameters:
invalidRgn - the invalidRgn that the client should redraw
 o setDisplayBounds
 public synchronized void setDisplayBounds(QDRect bounds) throws QTException
This method is called automatically via the QTCanvas object associated with this client to set the boundary of the movie.

Parameters:
bounds - a QDRect object describing the boundary
 o setLocation
 public void setLocation(int x,
                         int y) throws QTException
A convenience method to set the position of a QTDrawable object.

Parameters:
x - the new x location
y - the new y location
 o getDisplayBounds
 public QDRect getDisplayBounds() throws StdQTException
This method is called automatically via the QTCanvas object associated with this client to set the boundary of the movie.

Parameters:
bounds - a QDRect object describing the boundary
 o task
 public final synchronized void task() throws QTException
This method performs idle processing for the QTPlayer and will be automatically called if this object is added to the TaskThread object.

Overrides:
task in class Tasking
See Also:
TaskThread
 o addedTo
 public void addedTo(Object interest)
This method is called by the specified object when the instance of the class that implements this interface is added to the object that is the source of the interest. The QTPlayer expects that the incoming object is some kind of java.awt.Component - in which case it registers its interest in mouse events from that Component source. If the incoming object is not some kind of Component then nothing is done.

Parameters:
interest - the object that is to be the source of interest for the the object that implements this interface.
 o removedFrom
 public void removedFrom(Object interest)
This method is called by the specified object when the instance of the class that implements this interface is removed from the object that is the source of the interest. The QTPlayer expects that the incoming object is some kind of java.awt.Component - in which case it removes its interest in mouse events from that Component source. If the incoming object is not some kind of Component then nothing is done.

Parameters:
interest - the object that was the source of interest for the the object that implements this interface.
 o keyPressed
 public void keyPressed(KeyEvent e)
Key pressed events are passed on to the movie controller

 o keyReleased
 public void keyReleased(KeyEvent e)
 o keyTyped
 public void keyTyped(KeyEvent e)
 o mousePressed
 public void mousePressed(MouseEvent e)
Mouse pressed events are passed on to the movie controller

 o mouseClicked
 public void mouseClicked(MouseEvent e)
 o mouseEntered
 public void mouseEntered(MouseEvent e)
 o mouseExited
 public void mouseExited(MouseEvent e)
 o mouseReleased
 public void mouseReleased(MouseEvent e)
 o setClip
 public void setClip(Region theClip) throws QTException
This method allows you to set a QTPlayer's clipping region.

Parameters:
theClip - a Region that defines the player's clipping region.
 o getClip
 public Region getClip() throws QTException
This method allows you to obtain information describing a QTPlayer's clipping regions.

Returns:
the clipping region of the entire QTPlayer object
 o setTime
 public void setTime(int time) throws StdQTException
Sets the player to the time specified. This time value at this level is a totally arbitrary value - what time that means in "real time" is determined by the implementor of the interface, typically the scale value will determine what a "real" time of 1 second is.

Parameters:
time - the new time value
 o getTime
 public int getTime() throws StdQTException
Returns the current time value of the object.

Returns:
the current time.
 o getDuration
 public int getDuration() throws StdQTException
Returns the duration of the media attached to the player. If the player has no media, or does not know the duration of its media it can return the constant kDurationUnknown.

Returns:
the media duration.
 o getTimeBase
 public TimeBase getTimeBase() throws QTException
 o setRate
 public void setRate(float rate) throws StdQTException
Sets the player to the playback rate. Typically a rate of zero will mean that the player is stopped, a positive value that the player is playing forwards, a negative value that the player is playing backwards.

Parameters:
rate - the new playback rate.
 o getRate
 public float getRate() throws StdQTException
Returns the current rate of the player.

Returns:
the playback rate
 o getScale
 public int getScale() throws QTException
Returns the time scale of the player - how many ticks per second.

Returns:
the current scale.
 o getVolume
 public float getVolume() throws QTException
Returns the volume setting (0 is silent or muted, 1 is unity gain)

 o setVolume
 public void setVolume(float val) throws QTException
Sets the volume.

 o isMuted
 public boolean isMuted() throws QTException
Returns the current mute status

 o setMuted
 public void setMuted(boolean flag) throws QTException
Allows the muting of the specific channel. When unmuted the AudioSpec object will return to its current volume setting.

Parameters:
flag - turn muting on - true or off - false.
 o setControllerVisible
 public void setControllerVisible(boolean flag) throws QTException
If true makes the MovieController visible, otherwise makes it invisible

 o isControllerVisible
 public boolean isControllerVisible() throws QTException
Returns the visible state of the controller.

 o setControllerSizeReserved
 public void setControllerSizeReserved(boolean flag) throws QTException
Sets parameters on the resize of the controller. If true then the size of controller and its movie will be set with the setDisplayBounds. If false then setDisplayBounds will resize the movie to the specified rectangle. Setting this flag will cause the movie and its controller to be resized.

Parameters:
flag - the resize flag
 o isControllerSizeReserved
 public boolean isControllerSizeReserved()
Returns true if display space is being reserved for the size of the controller


All Packages  Class Hierarchy  This Package  Previous  Next  Index